// 
import 'package:hktk_app/util/view_util.dart';

/// 设置相关数据信息
class SzInfoModel {
  /// 这里是具体的值
  final Map<double, double> _sliderValue = {
    32.0: 32,
    33.0: 33,
    34.0: 34,
    35.0: 35,
    36.0: 36,
    37.0: 37,
    38.0: 38,
    39.0: 39,
    40.0: 40,
    41.0: 41,
    42.0: 42,

    10.0: 10,
    11.0: 11,
    12.0: 12,
    13.0: 13,
    14.0: 14,
    15.0: 15,
    16.0: 16,
    17.0: 17,
    18.0: 18,
    19.0: 19,
    20.0: 20,
    21.0: 21,
    22.0: 22,
    23.0: 23,
    24.0: 24,
    25.0: 25,
  };

  /// 是否自动跳转下一题，true：跳转，false：不跳转
  bool zdtz;

  /// 是否显示夜间模式，true：显示，false：不显示
  bool yjms;

  /// 字体大小，这里是显示的对应值
  double ztdx;

  SzInfoModel({
    required this.zdtz,
    required this.yjms,
    required this.ztdx,
  });

  SzInfoModel.fromJson(Map<String, dynamic> json)
      : zdtz = true,
        yjms = false,
        ztdx = 20.0 {
    zdtz = json["zdtz"] ?? true;
    yjms = json["yjms"] ?? false;
    ztdx = json["ztdx"] ?? 20.0;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data["zdtz"] = zdtz;
    data["yjms"] = yjms;
    data["ztdx"] = ztdx;
    return data;
  }

  double? getZtdxPx() {
    return _sliderValue[ztdx];
  }
}
